package JavaHomework03;

public class zuoye04 {
	public static void main(String[] args){
		int ge,shi,bai,sum,count=0,flag=0;	
		
		for(int i=1;i<1000;i++)
		{
			count=0;
			if(i>=100){
				ge = i%10;
				shi= i/10%10;
				bai= i/100;
				sum=ge*100+shi*10+bai;
			}else if(i>=10 && i<100){
				ge=i%10;
				shi=i/10;
				sum=ge*10+shi;
			}else{
				sum=i;
			}
			
			if(i == sum){			
				for(int j=1;j<sum;j++){
					if(sum%j==0){
						count++;
					}
				}
				if(count==1){
					System.out.print(sum+" ");
					flag++;
					if(flag%10==0){
						System.out.println();
					}
				}					
			}
		}					
	}
}
